﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace pandx.Mulan.Flows
{
    public class FlowNode
    {
        public const string Start = "start";
        public const string End = "end";
        public const string Task = "task";

        public string Id { get; set; }
        public string Name { get; set; }
        public string Type { get; set; }
        public string TypeName { get; set; }
        public string Left { get; set; }
        public string Top { get; set; }
        public string Icon { get; set; }
        public bool ViewOnly { get; set; }

        public Info Info { get; set; }
    }

    public class Info
    {
        public const string Everyone = "EVERYONE";
        public const string DesignUser = "DESIGNUSER";
        public const string DesignRole = "DESIGNROLE";
        public const string RunningUser = "RUNNINGUSER";
        public const string RunningRole = "RUNNINGROLE";
        
        public string Allot { get; set; }
        public long[] Users { get; set; }
        public int[] Roles { get; set; }
        public string UserText { get; set; }
        public string RoleText { get; set; }
        public string JoinType { get; set; }
        public List<Sign> Signs { get; set; }
        public bool Copy { get; set; }
        public long[] CopyUsers { get; set; }
        public string CopyUserText { get; set; }
        public bool SameUnit { get; set; }
        public int[] RestrictRoles { get; set; }
        public string RestrictRoleText { get; set; }
    }

    public class Sign
    {
        public SignState SignState { get; set; }
        public DateTime? SignTime { get; set; }
        public long UserId { get; set; }
        public string UserName { get; set; }
        public string Description { get; set; }
    }

    public enum SignState
    {
        Null=0,
        Yes = 1,
        No = 2,
        Reject = 3,
    }
    
}
